package com.platform.task.core;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.Trigger;

import com.platform.task.core.enums.TaskTypeEnum;
import com.platform.task.core.impl.ThreadPoolTaskSchedulerComponent;

public class TaskManager {
	@Autowired
	ThreadPoolTaskSchedulerComponent threadPoolTaskSchedulerComponent;
	
	public void registerScheduleWithFixedDelay(Task task, long delay,TaskTypeEnum taskType){
		threadPoolTaskSchedulerComponent.registerScheduleWithFixedDelay(task, delay, taskType);
	}
	public void registerSchedule(Task task, Trigger trigger,TaskTypeEnum taskType){
		threadPoolTaskSchedulerComponent.registerSchedule(task, trigger, taskType);
	}
	public void destorySchedule(String taskName){
		threadPoolTaskSchedulerComponent.destorySchedule(taskName);
	}
	
}
